﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Threading;
using System.Windows.Forms;

namespace MPMovieCatalog.Forms
{

    public delegate void CancelHandler();

    public partial class ProgressForm : Form
    {
        public ProgressForm()
        {
            InitializeComponent();
        }

        public string Label
        {
            get
            {
                return label.Text;
            }

            set
            {
                label.Text = value;
            }
        }

        public int Percentage
        {
            get
            {
                return progressBar.Value;
            }

            set
            {
                progressBar.Value = value > 100 ? 100 : value;
            }
        }

        public event EventHandler Cancel;

        private void cancelButton_Click(object sender, EventArgs e)
        {
            if (Cancel != null)
            {
                Cancel(sender, e);
            }
        }
    }
}
